home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / lib / ubiquity / localechooser / languagemap < prev    next >
Text File  |  2009-10-28  |  943b  |  50 lines

  1. #!/bin/sh
  2. #
  3. # Usage:
  4. #   LANGNAME=<value>
  5. #   . languagemap
  6. #
  7. # The calling script should provide the log() function
  8.  
  9. for list in /etc/languagelist /usr/lib/ubiquity/localechooser/languagelist ./languagelist; do
  10.     if [ -f "$list" ]; then
  11.         languages="$list"
  12.         break
  13.     fi
  14. done
  15.  
  16. log "Language = '$LANGUAGE'"
  17.  
  18. line=$(grep "^$LANGUAGE;" $languages || true)
  19. log "line=$line"
  20.  
  21. DEFAULT_COUNTRY=""
  22. FALLBACKLOCALE=""
  23. LOCALE=""
  24. LANGUAGELIST=""
  25. CONSOLE=""
  26.  
  27. if [ "$line" ] ; then
  28.     OLD_IFS="$IFS"
  29.     IFS=';'
  30.     set $line
  31.     IFS="$OLD_IFS"
  32.  
  33.     if [ "$3" ]; then DEFAULT_COUNTRY="$3" ; fi
  34.     if [ "$4" ]; then ENCODING="$4"; fi
  35.     if [ "$5" ]; then FALLBACKLOCALE="$5" ; LOCALE="$5" ; fi
  36.     if [ "$6" ]; then LANGUAGELIST="$6"; fi
  37.     if [ "$7" ]; then CONSOLE="$7"; fi
  38.  
  39.     if [ -z "$LANGUAGELIST" ] ; then
  40.         LANGUAGELIST="$LANGUAGE"
  41.     fi
  42. else
  43.     log "error: Unable to locate info for language '$LANGUAGE'"
  44.     LANGUAGE=C
  45.     DEFAULT_COUNTRY=US
  46.     ENCODING=""
  47.     LOCALE=C
  48.     LANGUAGELIST=en
  49. fi
  50.